package com.sso.service.impl;

import java.util.List;

import com.sso.dao.IDicSystemUserDao;
import com.sso.entity.DicSystem;
import com.sso.entity.DicSystemUser;
import com.sso.service.IDicSystemUserService;

public class DicSystemUserServiceImpl implements IDicSystemUserService{
	private IDicSystemUserDao dicSystemUserDao;

	public IDicSystemUserDao getDicSystemUserDao() {
		return dicSystemUserDao;
	}

	public void setDicSystemUserDao(IDicSystemUserDao dicSystemUserDao) {
		this.dicSystemUserDao = dicSystemUserDao;
	}

	@Override
	public void deleteDicSystemUser(DicSystemUser user) {
		dicSystemUserDao.delete(user);
	}

	@Override
	public List<DicSystemUser> getAllSystemUser() {
		return dicSystemUserDao.getAll();
	}

	@Override
	public DicSystemUser getByUserID(String userID) {
		return dicSystemUserDao.getById(userID);
	}

	@Override
	public List<DicSystemUser> getByUserName(String userName) {
		return dicSystemUserDao.findAllByNamedQuery("sr.getUserByName", userName);
	}

	@Override
	public void saveDicSystemUser(DicSystemUser user) {
		dicSystemUserDao.saveOrUpdate(user);
	}
	
	
}
